import { deepProxy } from '@/utils/utils';
import { triggerEventMap } from './event';
const obj = {
  currentPage: 1,
  pageSizes: [20, 50, 100, 200],
  pageSize: 20,
  total: 0,
  pageLayout: 'total, sizes, prev, pager, next, jumper',
  connectLoading: false,
  table: {
    loading: false,
    headerCellStyle: { 'text-align': 'center' },
    cellStyle: { 'text-align': 'center' },
    tableHead: [
      { title: '排序', key: 'idd' },
      { title: '执行器名称', key: 'title' },
      { title: 'AppName', key: 'appName' },
      { title: '在线机器', key: 'addressList' }
    ],
    data: []
  }
};
export const state = deepProxy(obj, {
  set(target, key, value, receiver) {
    target[key] = value;
    if (Object.keys(triggerEventMap).includes(key)) {
      triggerEventMap[key](receiver);
    }
    return true;
  }
});

